<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 光的代言人
  Date: 2024/12/20
  Time: 19:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>购物车 - 在线购物商城</title>
    <link rel="stylesheet" href="../../css/cartInfo/list.css">
</head>
<body>
<div class="header">
    <div class="header-content">
        <a href="/shopping/list" class="logo">在线购物商城</a>
        <div class="search-box">
            <input type="text" placeholder="请输入商品名称">
            <button class="search-btn">搜索</button>
        </div>
    </div>
</div>
<div class="container">
    <div class="cart-header">
        <h2>购物车</h2>
        <span class="cart-count">全部商品(${cartCount})</span>
    </div>
    <div class="cart-content">
        <div class="cart-table-header">
            <span class="col-checkbox">选择</span>
            <span class="col-goods">商品信息</span>
            <span class="col-price">单价</span>
            <span class="col-quantity">数量</span>
            <span class="col-total">小计</span>
            <span class="col-action">操作</span>
        </div>
        <div class="cart-items">
            <c:forEach items="${cartInfoList}" var="map">
                <div class="cart-item">
                    <div class="item-checkbox">
                        <input type="checkbox" name="cart_id">
                    </div>
                    <div class="item-info">
                        <img src="/goodsPic/${map.pic}" alt="商品图片">
                        <div class="item-details">
                            <div class="item-title">${map.goods_name}</div>
                        </div>
                    </div>
                    <div class="item-price">¥${map.price}</div>
                    <div class="item-quantity">
                        <button class="quantity-btn minus">-</button>
                        <input type="text" value="${map.quantity}" class="quantity-input">
                        <button class="quantity-btn plus">+</button>
                    </div>
                    <div class="item-total">¥${map.allPrice}</div>
                    <div class="item-action">
                        <a href="/shopping/cartInfo/delete?id=${map.cart_id}" class="delete-btn">删除</a>
                    </div>
                </div>
            </c:forEach>
        </div>
    </div>
    <div class="cart-footer">
        <div class="footer-left">
            <label class="checkbox-wrapper">
                <input type="checkbox" class="select-all">
                <span>全选</span>
            </label>
        </div>
        <div class="footer-right">
            <div class="total-info">
                <span>已选择 <em>0</em> 种商品</span>
                <span class="total-price">合计：<em>¥0</em></span>
            </div>
            <button class="checkout-btn">结算</button>
        </div>
    </div>
</div>
<script src="${pageContext.request.contextPath}/jsp/cartInfo/cart.js"></script>
</body>

</html>
